//没有token 令牌字符串，则强制跳转登录页
console.log(111);
const token = localStorage.getItem('token')
if (!token) {
  location.href = '../login/index.html'
}

// 请求个人信息并设置在页面上
axios({
  url: '/v1_0/user/profile'
}).then(result => {
  document.querySelector('.nick-name').innerHTML = result.data.data.mobile
})

// 点击退出登录

document.querySelector('.quit').addEventListener('click', () => {
  localStorage.clear()
  myAlert(true, '退出成功')
  setTimeout(() => {
    location.href = '../login/index.html'
  }, 2000)
})






